/*
*
* Created by yuri at May 1, 2011
*
*/



package implementation.client;

public class SwitchRunnable implements Runnable {
	
	private Runnable _r;
	private volatile boolean _stop;
	
	public SwitchRunnable (Runnable r) {
		this._stop = false;
		this._r = r;
	}

	@Override
	public void run() {
		while (!this._stop) {
			this._r.run();
		}
	}
	
	public void stop() {
		this._stop = true;
	}

}
